<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<ui:composition template="template.xhtml">
	<ui:define name="content">
		<h:head>
			<title>City Information</title>
		</h:head>
		<body>
			<f:view>
				<h:form>
					<h:panelGrid columns="2" style="width: 117px; ">

						<p:dataTable id="listcities" var="cityListItem"
							value="#{searchQuery.cities}">

							<p:column headerText="Name" style="width:24%">
								<h:outputText value="#{cityListItem.name}" />
							</p:column>

							<p:column headerText="Temperature" style="width:24%">
								<h:outputText value="#{cityListItem.temp}" />
							</p:column>

							<p:column style="width:4%">

								<h:commandButton action="#{cityController.queryCity}"
									value="Show City">
									<f:setPropertyActionListener
										target="#{citySelection.currentItem}"
										value="#{cityListItem.resource}" />
								</h:commandButton>

							</p:column>

						</p:dataTable>
					</h:panelGrid>
				</h:form>
			</f:view>
		</body>
	</ui:define>
</ui:composition>
</html>